<?php
/* @var $this RoleSourceController */
/* @var $model RoleSource */
/* @var $form CActiveForm */
?>

<div class="form">

    <?php
    $form = $this->beginWidget('CActiveForm', array(
        'id' => 'role-source-form',
        'enableAjaxValidation' => true,
            ));
    ?>

    <?php echo $form->errorSummary($model); ?>

    <div class="row">
        <?php echo $form->labelEx($model, 'pid'); ?>
        <?php echo $form->dropDownList($model, 'pid', array('' => '作为顶级') + CHtml::listData(RoleSource::model()->findAll('pid=0'), 'id', 'source_name')); ?>
        <?php echo $form->error($model, 'pid'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model, 'source_name'); ?>
        <?php echo $form->textField($model, 'source_name', array('size' => 60, 'maxlength' => 255)); ?>
        <?php echo $form->error($model, 'source_name'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model, 'source_value'); ?>
        <?php echo $form->textField($model, 'source_value', array('size' => 60, 'maxlength' => 255)); ?>
        <?php echo $form->error($model, 'source_value'); ?>
    </div>

    <div class="row buttons">
        <?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
    </div>

    <?php $this->endWidget(); ?>

</div><!-- form -->